
//	首页
export function toHomePage () {
	uni.switchTab({
		url: '/pages/tabBar/home/index'
	})
}

//	策略
export function toStrategyPage () {
	uni.switchTab({
		url: '/pages/tabBar/strategy/index'
	})
}

//	行情
export function toRankPage () {
	uni.switchTab({
		url: '/pages/tabBar/rank/index'
	})
}

//	用户
export function toUserPage (i) {
	uni.switchTab({
		url: '/pages/tabBar/user/index?id='+i
	})
}

//	登录成功跳转用户界面（清空其他所有界面）
export function toUserLaunch (isto=false) {
	let url='../../tabBar/home/index'
	 isto?uni.navigateBack():uni.reLaunch({url: url})
}

//	行情搜索
export function toRankSearchPage (isRedirect=false) {
	let url = '/pages/rank/search'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}



/* ================================================== 策略 ================================================== */
//	策略详情
export function toStrategyDetailPage (id, isRedirect=false) {
	let url = '/pages/strategy/detail/index?id=' + id
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}

//	订阅策略
export function toStrategyPayPage (id, isRedirect=false) {
	let url = '/pages/strategy/pay/index?id=' + id
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}

//	观摩大盘
export function toStrategyMarketPage (isRedirect=false) {
	let url = '/pages/strategy/market/index'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}

//	策略搜索
export function toStrategySearchPage (isRedirect=false) {
	let url = '/pages/strategy/search/index'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}
/* ================================================== 策略 ================================================== */



/* ================================================== 用户 ================================================== */

//	用户登录
export function toUserLoginPage (isRedirect=false) {
	let url = '/pages/user/login/index'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}

//	用户注册
export function toUserRegisterPage (isRedirect=false) {
	let url = '/pages/user/register/index'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}

//	用户同意协议并注册
export function toUserRegisterConfirmPage (phone, isRedirect=false) {
	let url = '/pages/user/register/confirm?phone=' + phone
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}

//	用户信息
export function toUserInfoPage (isRedirect=false) {
	let url = '/pages/user/info/index?id=sdfsdfsdfsdfsdf'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}

//	忘记密码
export function toUserResetPassPage (phone,isRedirect=false) {
	let url = '/pages/user/reset-pass/index'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}

// //	确认重置密码
// export function toUserResetPassConfirmPage (phone,isRedirect=false) {
// 	let url = '/pages/user/reset-pass/confirm'
// 	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
// }

//	用户实名认证
export function toUserRealNamePage (isRedirect=false) {
	let url = '/pages/user/real-name/index'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}

//意见反馈
export function tofeedbackPage (isRedirect=false) {
	let url = '/pages/user/feedback/feedback'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}
//	风险评估
export function toappraisalpahe (isRedirect=false) {
	let url = '/pages/user/appraisal/appraisal'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}
//自动化交易
export function toAutomatedTrading (isRedirect=false) {
	let url = '/pages/user/automatedTrading/index'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}
//	用户设置
export function toUserSetUpPage (isRedirect=false) {
	let url = '/pages/user/set-up/index'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}

//	用户消息
export function toUserMessagePage (isRedirect=false) {
	// let url = '/pages/user/message/index'
	let url = '/pages/user/newMsgcenter/index'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}

//	用户消息
export function toUserMessageDetailPage (id, isRedirect=false) {
	let url = '/pages/user/message/detail/index?id=' + id
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}

//	用户消息
export function toUserStrategyPage (isRedirect=false) {
	let url = '/pages/user/strategy/index'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}

//	我的优惠券
export function toUserCouponPage (isRedirect=false) {
	let url = '/pages/user/coupon/index'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}

//	用户基本信息
export function toUserBasisInfoPage (isRedirect=false) {
	let url = '/pages/user/basisInfo/index'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}
//签到
export function toUsersignPage (isRedirect=false) {
	let url = '/pages/user/sign/sign'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}
// //	资金详情
// export function toUserFundsDetailPage (isRedirect=false) {
// 	let url = '/pages/user/funds-detail/index'
// 	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
// }

// //	第三方登录
// export function toUserOtherLoginPage (isRedirect=false) {
// 	let url = '/pages/user/other-login/index'
// 	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
// }

/* ================================================== 用户 ================================================== */



/* ================================================== 开户 ================================================== */
//	开户帮助
export function toAccountHelpPage (isRedirect=false) {
	let url = '/pages/account/help/index'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}

//	快速开户
export function toAccountOpenPage (isRedirect=false) {
	let url = '/pages/account/open/index'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}
/* ================================================== 开户 ================================================== */



/* ================================================== 协议 ================================================== */
//	用户协议
export function toUserProtocolPage (isRedirect=false) {
	let url = '/pages/protocol/user/index'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}

//	策略协议
export function toStrategyProtocolPage (isRedirect=false) {
	let url = '/pages/protocol/strategy/index'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}
/* ================================================== 协议 ================================================== */



/* ================================================== 新闻资讯 ================================================== */

//	新闻资讯
export function toNewsPage (isRedirect=false) {
	let url = '/pages/news/list/index'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}

//	新闻详情
export function toNewsDetailPage (info, isRedirect=false) {
	// if (info.show_title == 1) {
		toNewsBasisPage(info.id)
	// } else {
	// 	toNewsBlankPage(info.id)
	// }
}

//	新闻基础详情
export function toNewsBasisPage (id, isRedirect=false) {
	let url = '/pages/news/detail/index?id=' + id
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}

//	新闻空白详情页
export function toNewsBlankPage (id, isRedirect=false) {
	let url = '/pages/news/blank/index?id=' + id
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}
/* ================================================== 新闻资讯 ================================================== */



/* ================================================== 系统页面 ================================================== */

//	关于我们
export function toAboutUs (isRedirect=false) {
	let url = '/pages/system/about-us/index'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}

//	用户协议
export function toUserAgreement (isRedirect=false) {
	let url = '/pages/system/user-agreement/index'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}

//	隐私协议
export function toPrivacyAgreement (isRedirect=false) {
	let url = '/pages/system/privacy-agreement/index'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}

//	新手指南
export function toSystemGuidePage (isRedirect=false) {
	let url = '/pages/system/guide/index'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}

//	新手指南详情
export function toSystemGuideDetailPage (id, isRedirect=false) {
	let url = `/pages/system/guide/detail/index?id=${id}`
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}
/* ================================================== 系统页面 ================================================== */





/* ================================================== 交易模块 ================================================== */

//	重置密码
export function toTraderEditPassPage (isRedirect=false) {
	let url = '/pages/trader/edit-pass/index'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}

//	资金详情
export function toTraderFundsDetailPage (isRedirect=false) {
	let url = '/pages/trader/funds-detail/index'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}

//	资金账号绑定
export function toTraderBindingPage (isRedirect=false) {
	let url = '/pages/trader/binding/index'
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}
/* ================================================== 交易模块 ================================================== */


/* ================================================== 跳转任意界面 ================================================== */
//	跳转任意界面
export function toAnyPage (url, isRedirect=false) {
	isRedirect ? uni.redirectTo({url}) : uni.navigateTo({url})
}
/* ================================================== 跳转任意界面 ================================================== */